------------------------------------
Directions for LTO Retrieval Program
------------------------------------
(rev. 9 June 2008,  Jim Mosher -- jimmosher@yahoo.com)

This program, "LTO_Retrieval.exe", can be used to retrieve a series of files from the LPI website and save them to the local disk.


*** Background Information ******************

Image files on the LPI site tend to called things like "72.jpg" or "150.jpg" etc., with the name appearing only in the name of the containing folder.  For example, the images of LTO39A3 at various resolutions are contained in a folder called:

http://www.lpi.usra.edu/resources/mapcatalog/LTO/lto39a3_1/

the "_1" part apparently meaning "revision 1" or "edition 1"??  

The names of the actual files in the folder are "72.jpg" or "150.jpg".



*** Creating a list of folder names for a map series *********

It is easy to create a list containing the folder URL's (such as the URL shown above) of ALL the maps in a given series, such as LAC, LTO, etc.  All you have to do is go to the catalog page showing the thumbnails of each map in the series and save that page to the local disk in the Web page archive ("*.mht") format of Internet Explorer or possibly the "HTML only" format of that or any other browser.

The list is hard for us to read, but easy for a computer.  For example, the folder URL shown above appears on a line that looks like this:

href=3D"http://www.lpi.usra.edu/resources/mapcatalog/LTO/lto39a3_1"><IMG =

The program simply looks for lines like this, beginning with the code "href=3D", and when it finds one, it extracts the part between the quote marks: in this case --

http://www.lpi.usra.edu/resources/mapcatalog/LTO/lto39a3_1

To this, it appends whatever suffix you specify on the program form.  If you specify a suffix of "/150dpi.jpg", the URL generated is:

http://www.lpi.usra.edu/resources/mapcatalog/LTO/lto39a3_1/150dpi.jpg

and the name assigned to the saved image is the name of the containing folder.


Note: by checking the "Test Mode" box you can preview with the URL's and destination image file names before actually attempting the downloads.



*** Operating Directions *****

1. Use your browser to open the thumbnail catalog page for the LPI image series you want to save to disk.  Using the browser, save that webpage as *.MHT file.

2. Start "LTO_Retrieval.exe"

3. Use the first button to located the saved *.MHT file with the list of image folders embedded in it.

4. Specify a "suffix" indicating the exact name of the image within the folder you want to download (the default of 150.jpg is probably the best for used with LTVT).

5. Indicate the folder on the local disk (or CD) where you want to save the images.  This can be a new folder created within the dialog. Note: ignore the words "Dummy_file" -- the system needs a name in order to "accept" the folder, but the actual name means nothing.

6. Click the RETRIEVE button to start the download.  You should see two lines like:

http://www.lpi.usra.edu/resources/mapcatalog/LTO/lto39a1_1/150dpi.jpg
C:\Moon Project\LPI Maps\LTO Series\LTO39A1.jpg

The first line shows the URL of the file being retrieved from the LPI site ("150dpi.jpg").  
The second line shows the name and destination of the file that will be saved on the local disk.

7. If the operation is successful, you will, after a few seconds, see the message:

  --> image saved

otherwise you will see:

  --> problem!

8. To halt a download run before getting to the end of the HTML list, click the ABORT button.  The program should halt after the current download is completed, and before starting the next one.

Note:  the program screen image is refreshed only between images downloads.  While a large download is in progress, the program is "busy" and the program screen may appear blank.  This can make it difficult to click the ABORT button, but I don't know how to fix this!



*** Resuming the download after an ABORT ****

There is no easy way to tell LTO_Retrieval.exe that you want to download only part of the URL's in an MHT or HTML list.  

So if you start again after an ABORT, the program will begin again at the start.  I suppose the program could keep track of what line number it is on, but it doesn't.

So the easiest way to resume after a partial download, is to open the HTML URL list in a text processor and use CTRL-F to search for the last image successfully downloaded.  Then re-save the file after erasing all the text "above" that in the file.

An alternative method is to check the "Test Mode" and "URL's only", this will generate a list of image source URL's with the desired name of the downloaded file appended at the end.  The list can be copied and pasted into a text document ("*.txt") which can be edited with any simple text processor, and then used as input for the LTVT Image Grabber ( http://ltvt.wikispaces.com/Utility+Programs ).



